
/**   
 * @Title: ActivityFragmentSupport.java 
 * @Package: com.rename.icode.activity 
 * @Description: Administrator版权所有
 * @author Administrator  
 * @date 2015-2-12 下午5:22:19 
 * @version  
 */


package com.rename.icode.activity;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;

/** 
 * @Description 实现了...功能
 * @author Administrator
 * @date 2015-2-12 下午5:22:19 
 * @version V1.0
 */

public class ActivityFragmentSupport extends FragmentActivity implements IActivitySupport {

	protected ICodeApplication icodeApplication = null;
	protected Context context = null;
	protected ProgressDialog pg = null;
	
	
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		context = this;
		pg = new ProgressDialog(context);
		pg.setCancelable(false);// 设置进度框是否可以通过按back键关闭
		icodeApplication = (ICodeApplication) getApplication();
		icodeApplication.addActivity(this);
	}

	/**
	 * Description  
	 * @see com.rename.icode.activity.IActivitySupport#stopService() 
	 */ 
		
	@Override
	public void stopService() {
		// TODO Auto-generated method stub
		
	}

	/**
	 * Description  
	 * @see com.rename.icode.activity.IActivitySupport#startConnService() 
	 */ 
		
	@Override
	public void startConnService() {
		// TODO Auto-generated method stub
		
	}

	/**
	 * Description  
	 * @see com.rename.icode.activity.IActivitySupport#startGeneralService() 
	 */ 
		
	@Override
	public void startGeneralService() {
		// TODO Auto-generated method stub
		
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#validateInternet() 
	 */ 
		
	@Override
	public boolean validateInternet() {
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#hasInternetConnected() 
	 */ 
		
	@Override
	public boolean hasInternetConnected() {
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * Description  
	 * @see com.rename.icode.activity.IActivitySupport#isExit() 
	 */ 
		
	@Override
	public void isExit() {
		// TODO Auto-generated method stub
		
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#hasLocationGPS() 
	 */ 
		
	@Override
	public boolean hasLocationGPS() {
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#hasLocationNetWork() 
	 */ 
		
	@Override
	public boolean hasLocationNetWork() {
		// TODO Auto-generated method stub
		return false;
	}

	/**
	 * Description 
	 * @param text
	 * @param longint 
	 * @see com.rename.icode.activity.IActivitySupport#showToast(java.lang.String, int) 
	 */ 
		
	@Override
	public void showToast(String text, int longint) {
		Toast.makeText(context, text, longint).show();
	}

	/**
	 * Description 
	 * @param text 
	 * @see com.rename.icode.activity.IActivitySupport#showToast(java.lang.String) 
	 */ 
		
	@Override
	public void showToast(String text) {
//		Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#getProgressDialog() 
	 */ 
		
	@Override
	public ProgressDialog getProgressDialog() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#getContext() 
	 */ 
		
	@Override
	public Context getContext() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#getVersion() 
	 */ 
		
	@Override
	public String getVersion() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Description 
	 * @return 
	 * @see com.rename.icode.activity.IActivitySupport#getICodeApplication() 
	 */ 
		
	@Override
	public ICodeApplication getICodeApplication() {
		return icodeApplication;
	}

	public void hideProgress() {
		if (pg != null) {
			pg.dismiss();
		}
	}
	
}
